#pragma once

#include "dfize.h"

struct SResource;
struct SBasicMaterial;
class CBlockSceneNode;

class CBuilding
{
public:
	CBuilding(CBlockSceneNode *block)
		: Block(block), RelativeTranslation(vector3df(0,0,0)), RelativeRotation(vector3df(0,0,0)), RelativeScale(vector3df(1,1,1)), Visible(true), Lighting(true),
		Resource(0), Material(0)
	{
	}

	~CBuilding();

	const matrix4 getAbsoluteTransformation() const;
	const matrix4 getRelativeTransformation() const;

	const vector3di getGlobalPosition() const;

	SBasicMaterial* getMaterial() const;
	void setMaterial(SBasicMaterial *m) { Material = m; }

	void setBuildingType(u32 buildingtype);

	vector3df RelativeTranslation, RelativeRotation, RelativeScale;
	aabbox3df BoundingBox, TransformedBoundingBox;
	SResource *Resource;
	u32 BuildingType;
	SBasicMaterial *Material;
	CBlockSceneNode *Block;
	bool Visible, Lighting;

private:
};